import java.awt.BorderLayout;
import javax.swing.JFrame;
import javax.swing.JPanel;
import javax.swing.SwingUtilities;

import controller.*;
import model.*;
import view.*;

//make frame stretch
//when importing words, check that the first letters dont match for logs in on row and no
//duplicate words
//score
//more points for longer words

public class mainFrame extends JFrame {

	private static final long serialVersionUID = 6977576048557950634L;
	private gameModelI model;
	private logController controlLogs;
	private userInputController controlInput;
	
	public mainFrame() {
    	super("Word Jump");
    	
    	//set up packages
        model = new gameModel(); 
        model.init();
        controlInput = new userInputController(model, null);
        JPanel game = new gamePanel(model, controlInput); //needs to know user input controller  
        JPanel title = new titlePanel();
        JPanel instr = new instrPanel();
        JPanel leader = new leaderBoardPanel();
        controlLogs = new logController(model, game, controlInput);
   
        controlInput.setView(game);
        
        //setup JFrame             
		setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
		setLayout(new BorderLayout()); //was BorderLayout()
		setSize(1000, 600);
		
		//setContentPane(instr);
		setContentPane(leader);
		
		//setContentPane(game);
		//controlLogs.start();
		
		//setContentPane(title);	
		
		pack();
		setVisible(true);
		setResizable(false);
		
		// Must do this to see KeyEvents.
		game.setFocusable(true);		
	}
	
	public void setPanel(JPanel p) {
		setContentPane(p);
		//contentPane.removeAll()
	}
 
	public static void main(String[] args) {
		SwingUtilities.invokeLater( new Runnable() {
			@Override public void run() {
				new mainFrame() ;
			}} ) ;
	}
}
	
		

   
        
	 

